Conversation
…6053 race conditions
📝 WalkthroughWalkthroughUpdated 25 package ChangesTypeScript include/glob updates
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 15 minutes. Comment |
|
View your CI Pipeline Execution ↗ for commit 60be407
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
|
Confirming this fix is needed — PR #10629 just hit the exact same TS6053 error in CI: https://github.com/TanStack/query/actions/runs/25282211546/job/74121119451 |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/angular-query-persist-client/tsconfig.json`:
- Line 13: The include glob in tsconfig.json currently uses brace expansion
("*.config.{ts,js,mjs,cjs}") which TypeScript doesn't support; update the
include array entry to four explicit patterns instead of the brace form (e.g.,
add "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs") so the include
in tsconfig.json correctly matches all intended config file extensions.
In `@packages/query-async-storage-persister/tsconfig.json`:
- Line 7: The tsconfig.json "include" pattern uses unsupported brace expansion
("*.config.{ts,js,mjs,cjs}") so those config files are not matched; update the
"include" array (the include property in tsconfig.json) to list each glob
separately (e.g., "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs")
alongside "src" and "package.json" so TypeScript will actually include those
config files.
In `@packages/query-codemods/tsconfig.json`:
- Line 7: The include pattern uses unsupported brace-expansion
("*.config.{ts,js,mjs,cjs}") in the tsconfig "include" array; replace it with
explicit patterns for each extension so TypeScript will match them (e.g., add
separate entries like "*.config.ts", "*.config.js", "*.config.mjs",
"*.config.cjs" or equivalent explicit globs) by updating the "include" array
entry that currently contains "*.config.{ts,js,mjs,cjs}".
In `@packages/react-query/tsconfig.json`:
- Around line 8-13: The tsconfig.json "include" entry uses unsupported brace
expansion "*.config.{ts,js,mjs,cjs}" so those config files aren't matched;
replace the brace with separate glob entries by expanding into individual
patterns (e.g., "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs") in
the "include" array so files like tsup.config.ts and vite.config.ts are picked
up; update the "include" array in packages/react-query/tsconfig.json
accordingly.
In `@packages/svelte-query-devtools/tsconfig.json`:
- Line 7: The tsconfig.json "include" entry uses unsupported brace expansion
("*.config.{ts,js,mjs,cjs}"); replace that single pattern with explicit glob
entries in the "include" array (e.g., "*.config.ts", "*.config.js",
"*.config.mjs", "*.config.cjs") so TypeScript will actually pick up those config
files; update the "include" array accordingly (referencing the "include" key and
the current "*.config.{ts,js,mjs,cjs}" pattern).
In `@packages/vue-query-devtools/tsconfig.json`:
- Line 7: The include pattern in tsconfig.json uses brace expansion
("*.config.{ts,js,mjs,cjs}") which TypeScript doesn't support; replace that
single brace-glob entry in the "include" array with explicit glob entries such
as "*.config.ts", "*.config.js", "*.config.mjs", and "*.config.cjs" (or a single
"*.config.*" if you want a broader match) so the config files are actually
picked up by the TypeScript compiler; update the include array entry that
currently contains the brace pattern accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f5fe14c1-e25c-4822-8a48-b77c4c3eccf2
📒 Files selected for processing (26)
packages/angular-query-experimental/tsconfig.jsonpackages/angular-query-persist-client/tsconfig.jsonpackages/eslint-plugin-query/tsconfig.jsonpackages/preact-query-devtools/tsconfig.jsonpackages/preact-query-persist-client/tsconfig.jsonpackages/preact-query/tsconfig.jsonpackages/query-async-storage-persister/tsconfig.jsonpackages/query-broadcast-client-experimental/tsconfig.jsonpackages/query-codemods/tsconfig.jsonpackages/query-core/tsconfig.jsonpackages/query-devtools/tsconfig.jsonpackages/query-persist-client-core/tsconfig.jsonpackages/query-sync-storage-persister/tsconfig.jsonpackages/query-test-utils/tsconfig.jsonpackages/react-query-devtools/tsconfig.jsonpackages/react-query-next-experimental/tsconfig.jsonpackages/react-query-persist-client/tsconfig.jsonpackages/react-query/tsconfig.jsonpackages/solid-query-devtools/tsconfig.jsonpackages/solid-query-persist-client/tsconfig.jsonpackages/solid-query/tsconfig.jsonpackages/svelte-query-devtools/tsconfig.jsonpackages/svelte-query-persist-client/tsconfig.jsonpackages/svelte-query/tsconfig.jsonpackages/vue-query-devtools/tsconfig.jsonpackages/vue-query/tsconfig.json
| "include": [ | ||
| "src", | ||
| "test-setup.ts", | ||
| "*.config.{ts,js,mjs,cjs}", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does TypeScript support brace expansion in tsconfig.json includeglobs (e.g.,"*.config.{ts,js,mjs,cjs}")? Please cite official TypeScript documentation or source code behavior.
💡 Result:
No. TypeScript’s tsconfig.json include/exclude glob patterns do not support Bash-style brace expansion like {ts,js,mjs,cjs}. TypeScript documents include as “filenames or patterns” and specifies only wildcard characters , ?, and / for its tsconfig globbing. The official docs list those supported wildcard characters and do not mention brace sets as a supported feature. Additionally, TypeScript’s own issue tracker documents that “curly braces aren't supported in our glob patterns” in the context of tsconfig include patterns. Practical implication: a pattern such as ".config.{ts,js,mjs,cjs}" will not be interpreted as multiple extensions by the TypeScript compiler; you need to spell out separate include patterns (e.g., ".config.ts", ".config.js", etc.) or use other mechanisms (like multiple tsconfig files / tooling) to cover those extensions.
Citations:
- 1: https://www.typescriptlang.org/tsconfig/
- 2: Visual studio and VS code don't apply tsconfig.json if it uses braces in glob microsoft/TypeScript#13062
- 3: Adds glob-style pattern matching for files in tsconfig.json microsoft/TypeScript#5980
Brace expansion is not supported in tsconfig.json include globs—update Line 13 to use explicit patterns.
TypeScript's glob patterns in tsconfig.json support only *, ?, and / wildcards. The pattern "*.config.{ts,js,mjs,cjs}" will not be interpreted as multiple extensions; use separate entries instead to ensure all intended config files are included.
Suggested fix
"include": [
"src",
"test-setup.ts",
- "*.config.{ts,js,mjs,cjs}",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
"package.json"
],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "*.config.{ts,js,mjs,cjs}", | |
| "include": [ | |
| "src", | |
| "test-setup.ts", | |
| "*.config.ts", | |
| "*.config.js", | |
| "*.config.mjs", | |
| "*.config.cjs", | |
| "package.json" | |
| ], |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/angular-query-persist-client/tsconfig.json` at line 13, The include
glob in tsconfig.json currently uses brace expansion
("*.config.{ts,js,mjs,cjs}") which TypeScript doesn't support; update the
include array entry to four explicit patterns instead of the brace form (e.g.,
add "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs") so the include
in tsconfig.json correctly matches all intended config file extensions.
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "*.config.*", "package.json"], | ||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"], |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In TypeScript tsconfig.json, does the includeglob syntax support brace expansion patterns like*.config.{ts,js,mjs,cjs}? Please cite official TypeScript documentation or source references for supported glob tokens.
💡 Result:
No. TypeScript’s tsconfig.json “include” glob syntax does not support brace expansion patterns like *.config.{ts,js,mjs,cjs}. Official TypeScript documentation states that “include”/“exclude” support only the wildcard characters * and ? and the special recursive token /, and it describes those as the supported glob wildcards. It does not mention brace/group expansion as supported. TypeScript’s own source for the include/exclude glob feature also lists supported tokens as , ?, and /, and explicitly notes that character escape sequences and character ranges are not supported—indicating that its glob syntax is intentionally limited rather than full brace-expansion syntax. Additionally, TypeScript maintainers have discussed brace usage not working in tsconfig patterns (e.g., curly braces not supported in glob patterns), corroborating that .{...} style expansion isn’t handled. Supported tokens (from TypeScript docs/source): - * matches zero or more characters (excluding directory separators) - ? matches any one character (excluding directory separators) - / recursively matches any subdirectory Therefore, to include multiple extensions in tsconfig.json, you need separate patterns (e.g., /.ts, /.js, etc.) rather than a single brace-expanded pattern.
Citations:
- 1: https://www.typescriptlang.org/tsconfig/
- 2: https://www.typescriptlang.org/tsconfig
- 3: Adds glob-style pattern matching for files in tsconfig.json microsoft/TypeScript#5980
- 4: Visual studio and VS code don't apply tsconfig.json if it uses braces in glob microsoft/TypeScript#13062
Update include pattern: brace expansion {ts,js,mjs,cjs} is not supported in TypeScript globs.
TypeScript's tsconfig.json include patterns support only *, ?, and / wildcards. The pattern *.config.{ts,js,mjs,cjs} will be treated literally and won't match any files, silently excluding intended config files from this project.
Use separate patterns instead:
"include": ["src", "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs", "package.json"]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/query-async-storage-persister/tsconfig.json` at line 7, The
tsconfig.json "include" pattern uses unsupported brace expansion
("*.config.{ts,js,mjs,cjs}") so those config files are not matched; update the
"include" array (the include property in tsconfig.json) to list each glob
separately (e.g., "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs")
alongside "src" and "package.json" so TypeScript will actually include those
config files.
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "*.config.*", "package.json"] | ||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"] |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does TypeScript tsconfig.json includesupport brace expansion patterns like"*.config.{ts,js,mjs,cjs}"? Please answer from official TypeScript docs and list supported wildcard syntax.
💡 Result:
No. TypeScript’s official tsconfig.json include/exclude glob syntax does not support brace expansion patterns like ".config.{ts,js,mjs,cjs}". Supported wildcard syntax for include and exclude in tsconfig.json (per the TypeScript TSConfig Reference): - * matches zero or more characters (excluding directory separators) - ? matches any one character (excluding directory separators) - / matches any directory nested to any level TypeScript’s docs explicitly describe only those wildcard characters for glob patterns in include/exclude, and do not list any support for {a,b} brace expansion. Practical implication: to include multiple extensions, you must use separate patterns (for example, /.config.ts, /*.config.js, etc.) rather than {ts,js,...}.
Citations:
- 1: https://www.typescriptlang.org/tsconfig/
- 2: https://www.typescriptlang.org/tsconfig
- 3: Adds glob-style pattern matching for files in tsconfig.json microsoft/TypeScript#5980
Brace-expansion glob syntax is not supported in TypeScript include patterns.
The pattern "*.config.{ts,js,mjs,cjs}" on Line 7 uses brace expansion, which TypeScript's glob syntax does not support. TypeScript only supports *, ?, and **/ wildcards in include and exclude fields. This means config files matching the intended pattern will not be included or type-checked. Use separate patterns for each extension instead.
Suggested fix
- "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"]
+ "include": [
+ "src",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"] | |
| "include": [ | |
| "src", | |
| "*.config.ts", | |
| "*.config.js", | |
| "*.config.mjs", | |
| "*.config.cjs", | |
| "package.json" | |
| ] |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/query-codemods/tsconfig.json` at line 7, The include pattern uses
unsupported brace-expansion ("*.config.{ts,js,mjs,cjs}") in the tsconfig
"include" array; replace it with explicit patterns for each extension so
TypeScript will match them (e.g., add separate entries like "*.config.ts",
"*.config.js", "*.config.mjs", "*.config.cjs" or equivalent explicit globs) by
updating the "include" array entry that currently contains
"*.config.{ts,js,mjs,cjs}".
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "tests", "*.config.*", "package.json"], | ||
| "include": ["src", "tests", "*.config.{ts,js,mjs,cjs}", "package.json"], |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does TypeScript's tsconfig.json "include" glob support brace expansion patterns like "*.config.{ts,js,mjs,cjs}"? Please provide official TypeScript documentation/source references.
💡 Result:
No. TypeScript’s tsconfig.json “include”/“exclude” glob patterns do not support brace expansion syntax like "*.config.{ts,js,mjs,cjs}". Officially, TypeScript documents that it supports only wildcard characters for tsconfig include/exclude patterns: *, ?, and / (and related rules). There is no mention of brace-expansion-style {a,b} patterns. Additionally, TypeScript’s own issue tracker records that “curly braces aren’t supported in our glob patterns”. What to do instead: spell out multiple patterns explicitly, e.g. include entries for *.config.ts, *.config.js, etc., or generate the expanded list with your tooling (since tsconfig itself won’t expand braces).
Citations:
- 1: https://www.typescriptlang.org/tsconfig
- 2: Visual studio and VS code don't apply tsconfig.json if it uses braces in glob microsoft/TypeScript#13062
Brace expansion in tsconfig.json include is unsupported; rewrite with explicit patterns.
TypeScript's include glob does not support brace expansion syntax. The pattern "*.config.{ts,js,mjs,cjs}" will not match config files as intended. Instead, list each extension separately.
Suggested fix
- "include": ["src", "tests", "*.config.{ts,js,mjs,cjs}", "package.json"],
+ "include": [
+ "src",
+ "tests",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/svelte-query-devtools/tsconfig.json` at line 7, The tsconfig.json
"include" entry uses unsupported brace expansion ("*.config.{ts,js,mjs,cjs}");
replace that single pattern with explicit glob entries in the "include" array
(e.g., "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs") so
TypeScript will actually pick up those config files; update the "include" array
accordingly (referencing the "include" key and the current
"*.config.{ts,js,mjs,cjs}" pattern).
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "*.config.*", "package.json"], | ||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"], |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
TypeScript tsconfig include glob syntax: are brace patterns like "*.config.{ts,js,mjs,cjs}" supported, or are only "*", "?", and "**/" supported?
💡 Result:
No, brace patterns like ".config.{ts,js,mjs,cjs}" are not supported in TypeScript tsconfig include. Only basic glob patterns "", "?", and "/" are supported, along with special handling for "." patterns where only supported file extensions are considered. To match multiple extensions like ts, js, mjs, cjs, you must list them separately: [".config.ts", ".config.js", ".config.mjs", ".config.cjs"].
Citations:
- 1: Adds glob-style pattern matching for files in tsconfig.json microsoft/TypeScript#5980
- 2: https://stackoverflow.com/questions/78721719/tsconfig-json-glob-patterns-e-g-ts-js-do-not-work-is-this-a-bug-or-exp
- 3: https://www.typescriptlang.org/tsconfig/
- 4: Visual studio and VS code don't apply tsconfig.json if it uses braces in glob microsoft/TypeScript#13062
- 5: https://www.typescriptlang.org/tsconfig
include uses brace-glob syntax that TypeScript does not support
The pattern *.config.{ts,js,mjs,cjs} uses brace expansion, which TypeScript's include glob does not support. TypeScript only recognizes *, ?, and **/; brace patterns are treated literally and config files won't be included as intended.
Proposed fix
- "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"],
+ "include": [
+ "src",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/vue-query-devtools/tsconfig.json` at line 7, The include pattern in
tsconfig.json uses brace expansion ("*.config.{ts,js,mjs,cjs}") which TypeScript
doesn't support; replace that single brace-glob entry in the "include" array
with explicit glob entries such as "*.config.ts", "*.config.js", "*.config.mjs",
and "*.config.cjs" (or a single "*.config.*" if you want a broader match) so the
config files are actually picked up by the TypeScript compiler; update the
include array entry that currently contains the brace pattern accordingly.
🎯 Changes
Narrow the
includepattern in allpackages/*/tsconfig.jsonfiles from*.config.*to explicit*.config.tsand*.config.js.Why
tsup bundles
tsup.config.tsinto a temporary ESM file namedtsup.config.bundled_<random>.mjsbefore loading it. This temporary file exists on disk for a few milliseconds during tsup builds.All package tsconfigs use
"include": ["*.config.*", ...], which is too broad and matches this temporary file. When Nx runs multiple tasks in parallel (e.g.,buildandtest:types), the TypeScript compiler may enumerate the temporary file, but by the time it tries to read it, tsup has already deleted it. This results in intermittent CI failures such as:Fix
Instead of relying on
excludeto filter out tsup's temporary files, narrow theincludepattern itself to only match config files with the extensions actually used in the repo:.tsand.js. This way, any temporary file with an unexpected name (e.g.,*.bundled_<random>.mjs) is naturally excluded.This approach is:
tsdown)excludeentryIf
.mjsor.cjsconfig files are added in the future, they can be added to theincludearray as a deliberate, scoped change.Real CI failures
Scope
Applied to all 26 packages using the
*.config.*include pattern, for consistency.✅ Checklist
🚀 Release Impact
Summary by CodeRabbit